// components/tupian-card/tupian-card.js
import formatTime from '../../style/formatTime.js'
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tupian:Object,
  },
  observers: {
    ['tupian.createTime'](val) {
      if (val) {
        this.setData({
          _createTime: formatTime(new Date(val))
        })
      }
    }
  },
  /**
   * 组件的初始数据
   */
  data: {
    _createTime:'',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    jvbao(event){
      wx.navigateTo({
        url: '/pages/index/jvbao/jvbao?tieziid=' + this.data.tupian._id +'&ip=' + this.data.tupian.ip +'&openid='+this.data.tupian._openid,
      })
    }
  }
})
